<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>Dev Tools For Free Software China</title>

    <!-- Bootstrap core CSS -->
    <link href="../../dist/css/bootstrap.min.css" rel="stylesheet">

    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <link href="../../assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="../../css/navbar.css" rel="stylesheet">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="../../assets/js/ie-emulation-modes-warning.js"></script>
    <script src="https://cdn.bootcss.com/json3/3.3.2/json3.min.js"></script>
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body>

<div class="container">
<#include  "../header.ftl"/>

    <!-- Main component for a primary marketing message or call to action -->
    <div class="jumbotron">

        <p> <textarea class="form-control" id="rawjson" rows="10"></textarea>  </p>

        <div class="btn-group ">
            <a class="btn  btn-primary" href="#" onclick="encode()" role="button">Base64加密</a>

            <a class="btn  btn-primary" href="#" onclick="decode()" role="button">Base64解密</a>
        </div>
        <p  style="padding: 5px;"> <textarea class="form-control" readonly id="base64str" rows="10"></textarea>  </p>
    </div>

</div> <!-- /container -->


<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
  <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>">
<script>window.jQuery || document.write('<script src="../../assets/js/vendor/jquery.min.js"><\/script>')</script>
<script src="../../dist/js/bootstrap.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="../../assets/js/ie10-viewport-bug-workaround.js"></script>
<script>


   function encode() {
       $.ajax({
           type: "GET",
           url: "/base64/encode",
           dataType: "json",
           data:"source="+$("#rawjson").val(),
           success: function(result) {
                console.log(result);
               console.log(result.data);
               $("#base64str").val(result.data);
           }
       });
   }
   function decode() {
       $.ajax({
           type: "GET",
           url: "/base64/decode",
           dataType: "json",
           data:"base64str="+$("#rawjson").val(),
           success: function(result) {
               console.log(result);
               console.log(result.data);
               $("#base64str").val(result.data);
           }
       });
   }
    function addFavorite2() {
        var url = window.location;
        var title = document.title;
        var ua = navigator.userAgent.toLowerCase();
        if (ua.indexOf("360se") > -1) {
            alert("由于360浏览器功能限制，请按 Ctrl+D 手动收藏！");
        } else if (ua.indexOf("msie 8") > -1) {
            window.external.AddToFavoritesBar(url, title);
            //IE8
        } else if (document.all) {
            try{ window.external.addFavorite(url, title);
            }catch(e){
                alert('您的浏览器不支持,请按 Ctrl+D 手动收藏!');
            }
        } else if (window.sidebar) {
            window.sidebar.addPanel(title, url, "");
        } else {
            alert('您的浏览器不支持,请按 Ctrl+D 手动收藏!'); } }
</script>
</body>
</html>
